package com.heima.zuoye.day12.timu4;

import java.io.Serializable;

public class Hero implements Serializable {
    private String name;
    private int sheng;
    private int gong;
    private int xiao;
    private double shi;

    public Hero() {
    }

    public Hero(String name, int sheng, int gong, int xiao) {
        this.name = name;
        this.sheng = sheng;
        this.gong = gong;
        this.xiao = xiao;
        this.shi = sheng * 0.5 + gong * 0.2 + xiao * 0.3;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSheng() {
        return sheng;
    }

    public void setSheng(int sheng) {
        this.sheng = sheng;
    }

    public int getGong() {
        return gong;
    }

    public void setGong(int gong) {
        this.gong = gong;
    }

    public int getXiao() {
        return xiao;
    }

    public void setXiao(int xiao) {
        this.xiao = xiao;
    }

    public double getShi() {
        return shi;
    }

    public void setShi(double shi) {
        this.shi = shi;
    }

    @Override
    public String toString() {
        return "Hero{" +
                "name='" + name + '\'' +
                ", sheng=" + sheng +
                ", gong=" + gong +
                ", xiao=" + xiao +
                ", shi=" + shi +
                '}';
    }
}
